From 0cb8cfe5628d4e9ec5ea8a252cc3ee28dc70f3cc Mon Sep 17 00:00:00 2001 From: Joseph Marrero Corchado Date: Thu, 2 Jul 2026 14:44:45 -0400 Subject: [PATCH] admin: Drop UNLOCKED flag from instutil set-kargs In bf59d0c6 we added `OSTREE_ADMIN_BUILTIN_FLAG_UNLOCKED` to the instutil subcommands, including `set-kargs`. At the time, this flag only controlled sysroot locking, and the commit message notes these commands were "only used by Anaconda" so locking was unnecessary. However, 599ffefe later consolidated mount namespace setup into the same `if (!UNLOCKED)` block, so `UNLOCKED` now also means "skip `ostree_sysroot_initialize_with_mount_namespace()`". Without the mount namespace, `_ostree_sysroot_ensure_writable()` is a no-op, and any subsequent write to `/sysroot` fails with EROFS on systems where the sysroot is mounted read-only (the default since composefs). The practical symptom is: $ ostree admin instutil set-kargs --import-proc-cmdline error: mkdir(boot.1.0): Read-only file system Dropping the flag is safe for the installer case: when not booted into an ostree-managed system, `initialize_with_mount_namespace()` returns early (since `root_is_ostree_booted` is FALSE), and the lock acquisition is harmless on a writable target sysroot. --- src/ostree/ot-admin-instutil-builtin-set-kargs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ostree/ot-admin-instutil-builtin-set-kargs.c b/src/ostree/ot-admin-instutil-builtin-set-kargs.c index 21b3d763..0fe4746a 100644 --- a/src/ostree/ot-admin-instutil-builtin-set-kargs.c +++ b/src/ostree/ot-admin-instutil-builtin-set-kargs.c @@ -58,9 +58,8 @@ ot_admin_instutil_builtin_set_kargs (int argc, char **argv, OstreeCommandInvocat context = g_option_context_new ("ARGS"); if (!ostree_admin_option_context_parse (context, options, &argc, &argv, - OSTREE_ADMIN_BUILTIN_FLAG_SUPERUSER - | OSTREE_ADMIN_BUILTIN_FLAG_UNLOCKED, - invocation, &sysroot, cancellable, error)) + OSTREE_ADMIN_BUILTIN_FLAG_SUPERUSER, invocation, &sysroot, + cancellable, error)) goto out; deployments = ostree_sysroot_get_deployments (sysroot); -- 2.39.5